import { getUserList } from '@/api/user';

export const contactSetting = [{
  label: '客户联系人',
  type: 'inputText',
  width: '130px',
  isRequired: true,
  keyword: 'contactPerson',
  onlyRead: true
}, {
  label: '联系方式',
  type: 'inputText',
  width: '200px',
  isRequired: true,
  isSecret: true,
  keyword: 'tel'
}, {
  label: '协作人',
  type: 'scrollSelect',
  width: '200px',
  keyword: 'associate',
  keyName: 'id',
  labelName: 'userName',
  renderKeyword: 'userName',
  showCheckUser: true,
  options: [],
  loadmoreMethod: getUserList,
  isDynamicLoad: true,
  multiple: true,
  valueType: 'object'
}, {
  label: '协作部门',
  type: 'inputText',
  width: '100px',
  disabled: true,
  keyword: 'coDepartmentName',
  onlyRead: true
}, {
  label: '备注',
  type: 'inputText',
  width: '130px',
  keyword: 'remark',
  maxlength: 200
}, {
  label: '创建人',
  type: 'inputText',
  width: '100px',
  disabled: true,
  keyword: 'creator',
  onlyRead: true
}, {
  label: '所属部门',
  type: 'inputText',
  width: 'auto',
  disabled: true,
  keyword: 'department',
  onlyRead: true
}, {
  label: '状态',
  type: 'inputText',
  onlyRead: true,
  keyword: 'status',
  statusFilter: function(status) {
    return {
      0: '禁用',
      1: '启用'
    }[status];
  },
  getColor(status) {
    return {
      0: '#FF4E5F',
      1: '#31CC9C'
    }[status];
  }
}, {
  label: '创建时间',
  type: 'inputText',
  width: '200px',
  disabled: true,
  keyword: 'createTime',
  formatTime: true,
  routerJump: true,
  onlyRead: true
}];

export const payerSetting = [{
  label: '付款人名称',
  type: 'inputText',
  width: '150px',
  isRequired: true,
  keyword: 'name'
}, {
  label: '付款账号',
  type: 'inputText',
  showType: 'secret',
  logText: '',
  width: '180px',
  isRequired: true,
  keyword: 'account'
}, {
  label: '协议附件',
  type: 'attachment',
  width: '150px',
  keyword: 'attachment',
  importApi: '/common/file/upload',
  uploadIcon: true
}, {
  label: '有效期',
  type: 'datepicker',
  pickerType: 'datetime',
  pickerFormat: 'yyyy/MM/dd HH:mm:ss',
  placeholder: '请选择时间范围',
  width: '200px',
  keyword: 'validTime',
  formatStr: 'YYYY/MM/DD HH:mm:ss'
}, {
  label: '协作人',
  type: 'scrollSelect',
  width: '200px',
  keyword: 'associate',
  keyName: 'id',
  labelName: 'userName',
  renderKeyword: 'userName',
  showCheckUser: true,
  options: [],
  loadmoreMethod: getUserList,
  isDynamicLoad: true,
  multiple: true,
  valueType: 'object'
}, {
  label: '协作部门',
  type: 'inputText',
  width: '100px',
  disabled: true,
  keyword: 'coDepartmentName',
  onlyRead: true
}, {
  label: '备注',
  type: 'inputText',
  width: '130px',
  keyword: 'remark',
  maxlength: 200
}, {
  label: '状态',
  type: 'inputText',
  onlyRead: true,
  keyword: 'status',
  statusFilter: function(status) {
    return {
      0: '禁用',
      1: '启用'
    }[status];
  },
  getColor(status) {
    return {
      0: '#FF4E5F',
      1: '#31CC9C'
    }[status];
  }
}, {
  label: '创建人',
  type: 'inputText',
  onlyRead: true,
  disabled: true,
  keyword: 'creator'
}, {
  label: '创建时间',
  type: 'inputText',
  onlyRead: true,
  keyword: 'createDate',
  width: '200px',
  formatTime: true
}, {
  label: '状态变更人',
  type: 'inputText',
  onlyRead: true,
  keyword: 'statusChanger'
}];
